const autoprefixer = require('autoprefixer');
// const pxtorem = require('postcss-pxtorem');
const path = require('path');

module.exports = {
  outputDir: './yuegesheji',
  productionSourceMap: false,
  // baseUrl: process.env.NODE_ENV === 'production' ? '/' : '/',
  css: {
    loaderOptions: {
      less: {
        modifyVars: {
          blue: '#409EFF', //info
          red: '#f44', //danger
          green: '#1b3c92', //primary
          orange: '#f08d49', //warn

          primary: '#1b3c92',
          warn: '#f08d49',
          danger: '#f44',
          info: '#1b3c92',
          'text-color': '#111',
        }
      },
      postcss: {
        plugins: [
          autoprefixer(),
          // pxtorem({
          //   rootValue: 37.5,
          //   propList: ['*']
          // })
        ]
      }
    }
  },
  
  configureWebpack: {
    entry: {
      app: './src/main.js',
      vendor: [
        'vue', 'vue-router', 'vuex'
      ]
    },
    resolve: {
      alias: {
        '@': path.resolve(__dirname, './src'),
        'src': path.resolve(__dirname, './src'),
        'store': path.resolve(__dirname, './src/store'),
        'public': path.resolve(__dirname, './public'),
      }
    }
  },

  devServer: {
    port: 6060,
    overlay: {
      warnings: true,
      errors: true
    },

    proxy: {
      "/api": {
        target: "http://ygsj.weituandui.com.cn",
        changeOrigin: true
      },
    }
  }
};
